
file( GLOB_RECURSE SOURCES "*.*" )
add_library( "FrameGraph" STATIC ${SOURCES} )
source_group( TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SOURCES} )
target_link_libraries( "FrameGraph" "VulkanLoader" )
target_include_directories( "FrameGraph" PUBLIC "." )
target_include_directories( "FrameGraph" PRIVATE "Vulkan" )
target_include_directories( "FrameGraph" PRIVATE "Vulkan/Buffer" )
target_include_directories( "FrameGraph" PRIVATE "Vulkan/CommandBuffer" )
target_include_directories( "FrameGraph" PRIVATE "Vulkan/Debugger" )
target_include_directories( "FrameGraph" PRIVATE "Vulkan/Descriptors" )
target_include_directories( "FrameGraph" PRIVATE "Vulkan/Image" )
target_include_directories( "FrameGraph" PRIVATE "Vulkan/Instance" )
target_include_directories( "FrameGraph" PRIVATE "Vulkan/Memory" )
target_include_directories( "FrameGraph" PRIVATE "Vulkan/Pipeline" )
target_include_directories( "FrameGraph" PRIVATE "Vulkan/RenderPass" )
target_include_directories( "FrameGraph" PRIVATE "Vulkan/RayTracing" )
target_include_directories( "FrameGraph" PRIVATE "Vulkan/Swapchain" )
target_include_directories( "FrameGraph" PRIVATE "Vulkan/Utils" )
set_property( TARGET "FrameGraph" PROPERTY FOLDER "" )

if (${FG_ENABLE_VMA})
	target_link_libraries( "FrameGraph" "VMA-lib" )
endif()
if (${FG_ENABLE_STDALLOC})
	target_link_libraries( "FrameGraph" "StdAlloc-lib" )
endif()

# Version
target_compile_definitions( "FrameGraph" PRIVATE "FG_VERSION_STR=\"${PROJECT_VERSION}\"" )
if (DEFINED FG_COMMIT_HASH)
	target_compile_definitions( "FrameGraph" PRIVATE "FG_COMMIT_HASH=\"${FG_COMMIT_HASH}\"" )
endif()

install( TARGETS "FrameGraph" ARCHIVE DESTINATION "libs/$<CONFIG>" )
install( DIRECTORY "Public" DESTINATION "include/FrameGraph" FILES_MATCHING PATTERN "*.h*" )
install( DIRECTORY "Shared" DESTINATION "include/FrameGraph" FILES_MATCHING PATTERN "*.h*" )
install( FILES "FG.h" DESTINATION "include/FrameGraph" )
